package com.training.controller;

import cn.dev33.satoken.util.SaResult;
import com.baomidou.mybatisplus.extension.toolkit.Db;
import com.training.entity.Role;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @BelongsProject: environment-supervision
 * @BelongsPackage: com.training.controller
 * @Author: Tianyu Han
 * @CreateTime: 2024-06-27  13:19
 * @Description: TODO
 * @Version: 1.0
 */
@RestController()
@RequestMapping("/role")
public class RoleController {

    @GetMapping
    public SaResult getRoleList() {
        List<Role> list = Db.lambdaQuery(Role.class).list();
        return SaResult.ok("获取角色列表成功").setData(list);
    }
}
